1. Field of the Invention
The present invention relates to a technique for encoding image data.
2. Description of the Related Art
A technique of dividing a still image into tiles and encoding the image by tile is known. For example, as one function in JPEG 2000 (ISO/ITU 15444-1:2000), tile division processing for dividing an image into small regions and independently encoding the small regions is adopted. Note that because the details of the JPEG 2000 method are described in international standard recommendations and the like, the details will be omitted here.
Because an image region can be specified by tile, it is possible, when executing tile division processing, to decode only a tile to be processed without processing regions other than the tile to be processed in an encoded state. Thus, image editing and image processing can be performed on only the tile to be processed.
However, because a tile size is fixed in the conventional image encoding, it is inconvenient to efficiently decode only a specific region. In other words, in an image, to encode a specific region to be processed in a manner convenient for processing, it is important to express the specific region using as small a number of tiles as possible and to reduce the tile size.
Regarding the tile size, when the specific region to be processed is fragmented or when the specific region to be processed is divided by a unit much larger than the specific region, access time to the specific region to be processed is prolonged. Further, when filter processing is performed over tiles, in the case of partial decoding by each tile, the image quality is degraded around tile boundaries. At this time, degradation of the region of interest is conspicuous when e.g. the specific region is decoded and displayed.
Further, in a case where the tile size is not fixed and tiles are obtained in a size the same as or close to that of the specific region to be processed, the compression ratio is lowered only in the specific region where excellent image quality must be maintained when performing encoding processing, while in other regions, the compression ratio is raised when performing encoding processing because the image quality may be degraded by some small measure. In this manner, encoding efficiency can be improved for the entire image.
As described above, image encoding for a tile having a variable tile size is required. Note that it is necessary to take the efficiency of encoding into consideration. Accordingly, the present inventor employs tile division where the width and height of a tile are variable, but each row has a fixed height and each column has a fixed width as in the case of cells in a table calculation application. More particularly, an image is tile-divided as shown in FIG. 2. In this division, as the tile size can be changed by only changing a ruled line position, the tile size in the image can be variable with a simple method. Because the tile size is variable in the image, access time to an object of interest is reduced. Further, because an appropriate compression method is applied to each tile, the compression efficiency can be improved.
As a conventional technique for allocating an appropriate sized tile to an object of interest, Japanese Patent Laid-Open No. 6-067300 as follows is known. The size of a face to be photographed is measured with an optical sensor or the like, and the scaling of the photographed image is changed based on the measured face size; in this way, a photograph in a standard size such as a photograph for a certification can be formed.
Further, a technique for, upon formation of a table, adjusting a cell size in correspondence with the size of character string or figure, e.g., Japanese Patent Laid-Open No. 6-083553 is known.
However, although methods for determining a cell size in correspondence with one object as in the case of the above-described method are known, a method for setting a tile in a smallest possible size for plural objects and performing encoding has not been proposed.